<?php
namespace Home\Controller;
use Think\Controller;
class CommonController extends Controller {
    public function _initialize(){
        //初始化
        if (!session('user')) { 
            $this->error('对不起,您还没有登录,正跳转至登录面...', U('Login/index'));
        }
    }
}